package com.tangkun.environment.activity;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.tangkun.environment.R;
import com.tangkun.environment.adapter.ImageAdapter;
import com.tangkun.environment.entity.gongzuo.PatientsReturn;
import com.tangkun.environment.utils.JumpHelper;
import com.tangkun.environment.view.SquareGridView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 新闻详情
 */
public class XinWenDetailActivity extends BaseActivity {

    @BindView(R.id.back)
    ImageView back;
    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.tv_xinwen_detail_biaoti)
    TextView tvXinwenDetailBiaoti;
    @BindView(R.id.tv_xinwen_detail_riqi)
    TextView tvXinwenDetailRiqi;
    @BindView(R.id.tv_xinwen_detail_fenlei)
    TextView tvXinwenDetailFenlei;
    @BindView(R.id.sgv_xinwen_detail)
    SquareGridView squareGridView;
    @BindView(R.id.tv_xinwen_detail_neirong)
    TextView tvXinwenDetailNeirong;
    private Context mContext;

    /**
     * ID
     */
    private String id = "";

    /**
     * 照片列表适配器
     */
    private ImageAdapter adapter;

    /**
     * 数据源
     */
    private List<PatientsReturn.Patients.ItemsBean> dataList = new ArrayList<PatientsReturn.Patients.ItemsBean>();
    /**
     * 图片数据源
     */
    private List<String> urlList = new ArrayList<String>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_xinwen_detail);
        mContext = this;
        ButterKnife.bind(this);
        id = getIntent().getStringExtra("id");
        title.setText("详情");
        initData();
    }

    private void initData() {
        adapter = new ImageAdapter(XinWenDetailActivity.this, urlList);
        squareGridView.setAdapter(adapter);

    }

    @OnClick({R.id.back})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.back:
                JumpHelper.finish(mContext);
                break;
        }
    }
}
